<template>
    <van-popup :show="spmdvisible" :close-on-click-overlay="false" @click-overlay="handleCancel" position="bottom" custom-style="height: 80%">
        <div class="contitle">
            <div class="title">职位详情</div>
            <div class="desc">
                <van-icon name="cross" @click="handleCancel" />
            </div>
        </div>
        <block v-for="(item,adindex) in queryColums" :key="adindex">
            <block v-for="(itemV, itemK) in queryParam" :key="itemK">
                <van-panel v-if="item.dname == itemK">
                    <div slot="header" class="panelheader">
                        <div class="title">{{item.title}} :</div><div class="status">{{itemV}}</div>
                    </div>
                </van-panel>
            </block>
        </block>
        <van-panel>
            <div slot="header" class="panelheader">
                <div class="title">笔试分数 :</div><div class="status">{{fsxdata.fsx}}</div>
            </div>
        </van-panel>
            <van-panel>
            <div slot="header" class="panelheader">
                <div class="title">面试分数 :</div><div class="status">{{fsxdata.fsxms}}</div>
            </div>
        </van-panel>
                <van-panel>
            <div slot="header" class="panelheader">
                <div class="title">总分数 :</div><div class="status">{{fsxdata.fsxtotal}}</div>
            </div>
        </van-panel>
    </van-popup>
</template>

<script>
    export default {
        props:{
            fsxactid:{ type: Number, default: 0 },
            visible:{ type: Boolean, default: false },
            queryColums:{ type: Array, default: () => [] },
            queryParam:{ type: Object, default: () => {} },
        },
        name: "zwdetail",
        data () {
            return {
                spmdvisible: this.visible,
                fsxdata: {},
            }
        },
        created () {
            this.getfsxdata()
        },
        methods: {
            getfsxdata(){
                var that = this;
                that.tableLoading = true;
				uni.request({
				    url: 'https://zg99.offcn.com/index/chaxun/getlist/?actid='+that.fsxactid+'&callback=?',
				    method: 'get',
				    dataType: 'jsonp',
				    data: { 
						year: that.queryParam.year,
						bmdm: that.queryParam.bmdm,
						zwdm: that.queryParam.zwdm,
						limits: 10
					},
				    success: function (res) {
				        var resjson = JSON.parse(res.data.substr(1, res.data.length-2));
				        if(resjson.status=="1"){
				            that.fsxdata = resjson.lists[0]
				        }else{
				            that.fsxdata = {}
				        }
				    },
				    complete: function() {
				        that.tableLoading = false
				    }
				})
            },
            //modal 取消返回
            handleCancel(){
                this.mdvisible(false)
            },
            //modal 关闭
            mdvisible(visible){
                this.$emit('update:visible', visible)
            }
        },
    };
</script>

<style scoped>
</style>